﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.Tokenizer.Symbols.CSharpSymbol
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

using System.Collections.Generic;
using System.Linq;
using System.Web.Razor.Parser.SyntaxTree;
using System.Web.Razor.Text;

namespace System.Web.Razor.Tokenizer.Symbols
{
  /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Represents a C sharp symbol for the razor tokenizer.</summary>
  public class CSharpSymbol : SymbolBase<CSharpSymbolType>
  {
    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Tokenizer.Symbols.CSharpSymbol" /> class.</summary>
    /// <param name="offset">The symbol’s offset.</param>
    /// <param name="line">The line.</param>
    /// <param name="column">The column</param>
    /// <param name="content">The content of the symbol.</param>
    /// <param name="type">The type of the symbol.</param>
    public CSharpSymbol(int offset, int line, int column, string content, CSharpSymbolType type)
      : this(new SourceLocation(offset, line, column), content, type, Enumerable.Empty<RazorError>())
    {
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Tokenizer.Symbols.CSharpSymbol" /> class.</summary>
    /// <param name="start">The location to start the symbol.</param>
    /// <param name="content">The content of the symbol.</param>
    /// <param name="type">The type of the symbol.</param>
    public CSharpSymbol(SourceLocation start, string content, CSharpSymbolType type)
      : this(start, content, type, Enumerable.Empty<RazorError>())
    {
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Tokenizer.Symbols.CSharpSymbol" /> class.</summary>
    /// <param name="offset">The symbol’s offset.</param>
    /// <param name="line">The line.</param>
    /// <param name="column">The column</param>
    /// <param name="content">The content of the symbol.</param>
    /// <param name="type">The type of the symbol.</param>
    /// <param name="errors">A list of errors.</param>
    public CSharpSymbol(
      int offset,
      int line,
      int column,
      string content,
      CSharpSymbolType type,
      IEnumerable<RazorError> errors)
      : base(new SourceLocation(offset, line, column), content, type, errors)
    {
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Initializes a new instance of the <see cref="T:System.Web.Razor.Tokenizer.Symbols.CSharpSymbol" /> class.</summary>
    /// <param name="start">The location to start the symbol.</param>
    /// <param name="content">The content of the symbol.</param>
    /// <param name="type">The type of the symbol.</param>
    /// <param name="errors">A list of errors.</param>
    public CSharpSymbol(
      SourceLocation start,
      string content,
      CSharpSymbolType type,
      IEnumerable<RazorError> errors)
      : base(start, content, type, errors)
    {
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets a value that indicates whether the symbol has an escaped identifier.</summary>
    /// <returns>true if the symbol has an escaped identifier; otherwise, false.</returns>
    public bool? EscapedIdentifier { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Gets or sets the language keyword.</summary>
    /// <returns>The language keyword.</returns>
    public CSharpKeyword? Keyword { get; set; }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Determines whether the specified object is equal to the current object.</summary>
    /// <returns>true if the specified object is equal to the current object; otherwise, false.</returns>
    /// <param name="obj">The object to compare to.</param>
    public override bool Equals(object obj)
    {
      CSharpSymbol csharpSymbol = obj as CSharpSymbol;
      if (!base.Equals(obj))
        return false;
      CSharpKeyword? keyword1 = csharpSymbol.Keyword;
      CSharpKeyword? keyword2 = this.Keyword;
      return keyword1.GetValueOrDefault() == keyword2.GetValueOrDefault() & keyword1.HasValue == keyword2.HasValue;
    }

    /// <summary>This type/member supports the .NET Framework infrastructure and is not intended to be used directly from your code.Returns the hash code for this current instance.</summary>
    /// <returns>The hash code for this current instance.</returns>
    public override int GetHashCode() => base.GetHashCode() ^ this.Keyword.GetHashCode();
  }
}
